1. Field of the Invention
The present invention relates to a digital signal processor (hereinafter referred to as "DSP") that computes logarithmic values or inverse logarithmic values for data values of an input signal.
2. Description of Background Information
In recent years, processing of analog signals has become an important task of signal processors, wherein a digital signal obtained by analog-to-digital conversion of an input analog signal is treated by a processor, constituting a circuit such as a wave filter, or a modulator circuit, and so forth. To realize the function of such a circuit by using a DSP, it is necessary to repeat a number of multiplication operations, so it is quite effective to substitute such multiplication operations with summing operations, for facilitating the computing operations. To permit the substitution of arithmetic operations, conversion of input values to logarithmic values, or subsequent inverse conversion of the logarithmic values, are often implemented.
When a logarithmic value Log (x) of an input value x is expanded into power series by the expansion according to the Taylor' theorem, the resultant power series can be expressed by the following equation (1). EQU Log (x)=c.sub.0 +c.sub.1 x+c.sub.2 x.sup.2 +c.sub.3 x.sup.3 +. . . (1)
Therefore, if the coefficients c.sub.0, c.sub.1, c.sub.2 . . . in the equation (1) are prepared, a logarithmic value can be obtained by sequentially performing operations of: computing the square (second power), the third power, . . . of the input signal x; multiplying a corresponding coefficient to the result of computation; and obtaining a sum total of the products.
Since various values ranging from a small value to a large value can be inputted as the value x to be substituted into the equation (1), the number n of coefficients c.sub.n to be prepared should be large enough to reduce the magnitude of errors below-a tolerance level for the whole range of the input signal.
Consequently, with conventional processors used for the logarithmic conversion, the coefficients c.sub.n are prepared up to a number which allows the error of the logarithmic value obtained by the conversion to be maintained below the tolerance level for a certain range of input value x, e.g., 0.999 through 0.1 of input value x. When the input value x is outside this range, the input value is shifted to a value within the range so that the computation is performed by using the shifted value, then a correction by a value corresponding to the shift amount is effected to the computed value.
Specifically, when the input value is 0.005, the input value desirably is shifted by two digits, i.e., multiplied by 10.sup.2, in order that the shifted value falls within the above-mentioned range of 0.999 through 0.1. After the multiplication of 0.005 by 10.sup.2, the input value has a value 0.5, and the logarithmic conversion is effected to this shifted value 0.5, to yield an output value -0.30103. The thus produced converted value is then processed by a shift correction operation.
The correction operation against the shift is performed by adding a logarithmic value of 10.sup.-2, that is, a value -2.00 in this case, to the computed result since the input value has been shifted upward by two digits (10.sup.2). Thus, the summed value -2.30103 is issued as the logarithmic conversion value of the input value x when x=0.005.
When an inverse logarithmic value 10.sup.x of an input value x is expanded into power series by the expansion according to the Taylor' theorem, the resultant power series can be expressed by the following equation (2). EQU 10.sup.x =r.sub.0 +r.sub.1 x+r.sub.2 x.sup.2 +r.sub.3 x.sup.3 +. . . (2)
Therefore, if the coefficients r.sub.0, r.sub.1, r.sub.2 . . . in the equation (2) are prepared, an inverse logarithmic value can be obtained by sequentially performing operations of: computing the square (second power), the third power, . . . of the input signal x; multiplying a corresponding coefficient to the result of computation; and obtaining a sum total of the products.
Since various values ranging from a small value to a large value can be inputted as the value x to be substituted into the equation (2), the number n of coefficients r.sub.n to be prepared should be large enough to reduce the magnitude of errors below a tolerance level for the whole range of the input signal.
Consequently, with processors used for the inverse logarithmic conversion, the coefficients r.sub.n are prepared up to a number which allows the error of the inverse logarithmic value obtained by the conversion to be maintained below the tolerance level for a certain range of input value x, e.g., 0.999 through 0.1 of input value x. When the input value x is outside the predetermined range, a certain number is added to the input value to produce a value within the predetermined range so that the computation is performed by using the summed value, then a correction is effected by dividing the computed value by a value corresponding to the number added to the input value.
Specifically, when the input value is 2.30103, a certain value -2 is suitably added to the input value, in order that the summed value falls within the above-mentioned range of 0.999 through 0.1. After the addition of the value -2, the summed value is equal to 0.30103, and the inverse logarithmic conversion is effected to the value 0.30103, to yield an output value 2.000. The thus produced converted value is then processed by a correction operation.
The correction operation in this case is performed by dividing the computed value by an inverse logarithmic value of 10.sup.-2, i.e., 0.01, or to multiply 10.sup.2 to the computed result since the value added to the input signal is -2. Thus, the resultant multiplied value 200.000 is issued as the inverse logarithmic conversion value of the input value x when x=2.30103.
As described previously, with the conventional DSP used to calculate the logarithmic value log x of the input value x, the input value is shifted so that it falls in a predetermined range, the computation operation for producing the logarithmic value is effected to the shifted input value, and a correction value corresponding to the amount shift is added to the result of computation. Consequently, there has been a drawback that a large number of processing steps are required, so that the a longer processing time is needed.
Furthermore, with the conventional DSP used to calculate the inverse logarithmic value 10.sup.x of the input value x, a certain number is added to the input value so that the summed value falls in a predetermined range, the computation operation for producing the inverse logarithmic value is effected to the summed value produced from the input value, and a correction value corresponding to the certain value added to the input value is multiplied to the result of computation. Consequently, there has been a drawback that a large number of processing steps are required, so that a longer processing time is needed.